//
//  TableViewCelltwo.m
//  BAOASystem
//
//  Created by michael on 2018/1/26.
//  Copyright © 2018年 czd. All rights reserved.
//

#import "TableViewCelltwo.h"

@implementation TableViewCelltwo
- (void)awakeFromNib {
    [super awakeFromNib];
        self.selectionStyle = UITableViewCellSelectionStyleNone;

    self.contentView.backgroundColor = [UIColor whiteColor];
     _cyleView = [[collectionviewtwo alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, 150)];

 
    // Initialization code
  
[_cyleView.collectionView reloadData];
}
- (void)layoutSubviews{
[super layoutSubviews];
   _cyleView.data = _dict[@"ctgMainPushProduct"];
 [self.bomview addSubview:_cyleView];
 _titlelabel.text = _dict[@"ctgName"];
 _zhutuilabel.text = NSLocalizedString(@"主推商品", nil);
_zuixinlabel.text = NSLocalizedString(@"最新发布", nil);
_reshoulabel.text = NSLocalizedString(@"热搜词",nil);
NSArray *ctgHotKeyWordListarray = _dict[@"ctgHotKeyWordList"];
if(ctgHotKeyWordListarray.count!=0){
  if (ctgHotKeyWordListarray.count>0) {

[_reshoubutton1 setTitle:ctgHotKeyWordListarray[0][@"title"] forState:UIControlStateNormal];
}  if (ctgHotKeyWordListarray.count>1) {

[_reshoubutton2 setTitle:ctgHotKeyWordListarray[1][@"title"] forState:UIControlStateNormal];
}  if (ctgHotKeyWordListarray.count>0) {

[_reshourightbutton sd_setImageWithURL:[NSURL URLWithString:ctgHotKeyWordListarray[0][@"fileurl"]] forState:UIControlStateNormal];
}
}
NSArray *ctgNewProductListarray = _dict[@"ctgNewProductList"];
if(ctgNewProductListarray.count!=0){
  if (ctgNewProductListarray.count>0) {

[_zuixinrightbutton sd_setImageWithURL:[NSURL URLWithString:ctgNewProductListarray[0][@"fileurl"]] forState:UIControlStateNormal];
}  if (ctgNewProductListarray.count>0) {

[_zuixinbutton1 setTitle:ctgNewProductListarray[0][@"title"] forState:UIControlStateNormal];
}  if (ctgNewProductListarray.count>1) {

[_zuixinbutton2 setTitle:ctgNewProductListarray[1][@"title"] forState:UIControlStateNormal];
}
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (IBAction)zuixinaction1:(id)sender {
NSArray *ctgNewProductListarray = _dict[@"ctgNewProductList"];
if (ctgNewProductListarray.count!=0){
NSDictionary *dic =ctgNewProductListarray[0];

shangpinxqViewController *vc = [[shangpinxqViewController alloc]init];
vc.pdid = dic[@"id"];
vc.hidesBottomBarWhenPushed = YES;
[self.ViewController.navigationController pushViewController:vc animated:YES];
}
}

- (IBAction)zuixinaction2:(id)sender {
NSArray *ctgNewProductListarray = _dict[@"ctgNewProductList"];
if (ctgNewProductListarray.count>1){
NSDictionary *dic =ctgNewProductListarray[1];

shangpinxqViewController *vc = [[shangpinxqViewController alloc]init];
vc.pdid = dic[@"id"];
vc.hidesBottomBarWhenPushed = YES;
[self.ViewController.navigationController pushViewController:vc animated:YES];
}
}

- (IBAction)zuixinrightaction:(id)sender {
NSArray *ctgNewProductListarray = _dict[@"ctgNewProductList"];
if (ctgNewProductListarray.count>0){
NSDictionary *dic =ctgNewProductListarray[0];

shangpinxqViewController *vc = [[shangpinxqViewController alloc]init];
vc.pdid = dic[@"id"];
vc.hidesBottomBarWhenPushed = YES;
[self.ViewController.navigationController pushViewController:vc animated:YES];
}
}
- (IBAction)reshourightaction:(id)sender {
NSArray *ctgHotKeyWordListarray = _dict[@"ctgHotKeyWordList"];
if (ctgHotKeyWordListarray.count>0){
NSDictionary *dic =ctgHotKeyWordListarray[0];

shangpinxqViewController *vc = [[shangpinxqViewController alloc]init];
vc.pdid = dic[@"id"];
vc.hidesBottomBarWhenPushed = YES;
[self.ViewController.navigationController pushViewController:vc animated:YES];
}
}

- (IBAction)reshouaction1:(id)sender {
NSArray *ctgHotKeyWordListarray = _dict[@"ctgHotKeyWordList"];
if (ctgHotKeyWordListarray.count>0){
NSDictionary *dic =ctgHotKeyWordListarray[0];

shangpinxqViewController *vc = [[shangpinxqViewController alloc]init];
vc.pdid = dic[@"id"];
vc.hidesBottomBarWhenPushed = YES;
[self.ViewController.navigationController pushViewController:vc animated:YES];
}
}

- (IBAction)reshouaction2:(id)sender {
NSArray *ctgHotKeyWordListarray = _dict[@"ctgHotKeyWordList"];
if (ctgHotKeyWordListarray.count>1){
NSDictionary *dic =ctgHotKeyWordListarray[1];

shangpinxqViewController *vc = [[shangpinxqViewController alloc]init];
vc.pdid = dic[@"id"];
vc.hidesBottomBarWhenPushed = YES;
[self.ViewController.navigationController pushViewController:vc animated:YES];
}
}
@end
